Lesson 0002 · ~15 min
Tokens are not words
Mission tie-in: if an LLM predicts the next token, you need a clear idea of what a token is. Tokens are the units the model actually sees, budgets, and generates.
Win for this lesson
By the end, you should be able to explain:
“What is a token, and why does tokenization matter in practice?”
Core idea
A token is a chunk of text used by the model’s tokenizer. It is not always a word and not always a single character. A token might be a whole word, part of a word, punctuation, whitespace pattern, or a short text fragment.
Why this matters
- Context limits: models have token limits, not word limits.
- Cost and speed: API usage is usually priced and bounded in tokens.
- Behavior: odd spacing, code, numbers, and rare strings can break into surprising token patterns.
- Prompt design: concise, structured prompts often work better partly because they use context more efficiently.
Mental model
Before the model can do next-token prediction, text is turned into tokens. The model processes token IDs, not raw characters or meanings directly.
- Text comes in
- Tokenizer splits it into tokens
- Tokens become IDs
- The model predicts the next token ID
- The token is decoded back into text
What this does not mean
- It does not mean tokenization is arbitrary noise.
- It does not mean models understand only tiny fragments.
- It does mean the interface between text and model computation has real consequences.
Pressure-test yourself
Prompt A
Why is “token” a better unit than “word” when describing how an LLM works?
Prompt B
Name two practical consequences of tokenization for someone using an LLM API or writing prompts.
Benchmark answers
Prompt A: Token is the right unit because the model consumes and generates token sequences, and tokens do not line up cleanly with words. Some words split into multiple tokens, while punctuation or spaces can also matter.
Prompt B: Tokenization affects context-window usage and API cost, and it can also change how reliably the model handles code, formatting, numbers, or unusual strings.
Mini drill
Rewrite this weak statement into a safer one:
The model reads words and writes words.
Use the terms tokenizer, tokens, and context window.
Takeaway
Important correction: LLMs do not operate directly on words. They operate on tokens, and tokenization shapes context usage, cost, and sometimes behavior.
Next step options
- Learn how tokens become vectors with embeddings
- Learn the difference between training and inference
- Learn why transformers need positional information
Send me your mini-drill answer and I’ll critique it, then we can move to embeddings.